<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    //echo "Welcom McDonald's.";

     return view('index');
});

// 后台
Route::group(['prefix'=>'adm'], function(){

    Route::get('login', 'Adm\Users\LoginController@login');
    Route::post('dologin', 'Adm\Users\LoginController@dologin');
    Route::get('signout', 'Adm\Users\LoginController@signout');
    Route::get('error', 'Adm\Video\VideoController@error');


    Route::group(['prefix'=>'user'], function(){

    });
});

Route::group(['prefix'=>'adm', 'middleware'=>['adm.token']], function(){

    Route::get('index', 'Adm\Users\UserController@index');
    Route::post('edituserpass', 'Adm\Users\UserController@edituserpass');

    // 后台管理员模块
    Route::group(['prefix'=>'user'], function(){
        Route::get('userlist', 'Adm\Users\UserController@userlist');
        Route::get('adduser', 'Adm\Users\UserController@adduser');
        Route::post('doadduser', 'Adm\Users\UserController@doadduser');
        Route::get('deluser', 'Adm\Users\UserController@deluser');
        Route::get('edituser', 'Adm\Users\UserController@editUserView');
        Route::post('doedituser', 'Adm\Users\UserController@doedituser');
    });

    // 后台管理员模块
    Route::group(['prefix'=>'order'], function(){
        Route::get('orderlist', 'Adm\Order\OrderController@orderlist');
        Route::get('orderdetail', 'Adm\Order\OrderController@orderDetail');
        Route::get('goodslist', 'Adm\Order\OrderController@goodslist');
        Route::get('addgoods', 'Adm\Order\OrderController@addGoods');
        Route::get('goodsdetail', 'Adm\Order\OrderController@goodsDetail');
        Route::any('doaddgoods', 'Adm\Order\OrderController@doAddGoods');
        Route::any('delgood', 'Adm\Order\OrderController@delgood');
        Route::get('reservationlist', 'Adm\Order\OrderController@reservationList');
    });


    // 后台会员模块
    Route::group(['prefix'=>'member'], function(){
        Route::get('memberlist', 'Adm\Member\MemberController@memberList');
        Route::any('addbonus', 'Adm\Member\MemberController@addBonus');
    });
});
